﻿/*
 * @Author Super听歌 qq:841739194
 * @Date 2021/2/22
 * @Version 1.0.0
 * @Description 音效管理器
 * 音效大小，开闭,初始化
 */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SoundManager : MonoBehaviour
{
    private AudioSource m_AudioSource;
    private float SoundVolume
    {
        get { return PlayerPrefs.GetFloat("SoundVolume",1.0f); }
        set
        {
          m_AudioSource.volume = value;
          PlayerPrefs.SetFloat("SoundVolume", 1.0f);
        }
    }

    private void Awake()
    {
        m_AudioSource = this.gameObject.GetComponent<AudioSource>();
        m_AudioSource.playOnAwake = false;
        m_AudioSource.loop = false;

    }
}
